async function run($input, $output, $modules = modules) {
  const sequelize = $modules.sequelize;

  try {
    let database = await $modules.helper.getConfig("database"); //数据库名称
    let domain = await $modules.helper.getConfig("domain"); //数据库地址
    let user = await $modules.helper.getConfig("user"); //数据库用户名
    let password = await $modules.helper.getConfig("password"); //数据库密码

    //初始化数据库连接
    const db = await sequelize.getDb(database, null, null, {
      dialect: "mssql",
      dialectOptions: {
        authentication: {
          type: "default",
          options: {
            domain: domain,
            userName: user,
            password: password,
          },
        },
        options: {
          encrypt: false,
        },
      },
    });

    //连接并验证数据库
    await db.authenticate();

    let tableName = "tableName"; //数据表名

    let table = db.models[tableName];
    //新增数据
    await table.create({
      a: "123",
      b: 0,
      c: new Date(),
    });

    //修改数据
    await table.update(
      {
        a: "123",
      },
      {
        where: {}, //查询条件
      }
    );

    //查询多条数据
    let list = await db.models[tableName].findAll({
      where: {}, //查询条件
    });

    //查询单条数据
    let item = await db.models[tableName].findOne({
      where: {}, //查询条件
    });

    modules.helper.log(list);
  } catch (error) {
    modules.helper.log(error);
  }
}
